package com.szewec.ps.base;

import android.app.Application;
import android.content.Context;

import com.baidu.mapapi.CoordType;
import com.baidu.mapapi.SDKInitializer;
import com.szewec.ps.util.LogUtil;
import com.szewec.ps.util.PreferincesContext;
import com.szewec.ps.util.SharedPreferencesUtil;
import com.youngfeng.snake.Snake;

public class BaseApplication extends Application {

    private static Context mContext;

    @Override
    public void onCreate() {
        super.onCreate();
        //获取整个应用上下文
        LogUtil.i("==================>","BaseApplication");
        mContext = getApplicationContext();
//        初始化SP存储
        SharedPreferencesUtil.getInstance(getApplicationContext(), PreferincesContext.LOCAL_STORAGE);
        //在使用SDK各组件之前初始化context信息，传入ApplicationContext
        SDKInitializer.initialize(this);
        //自4.3.0起，百度地图SDK所有接口均支持百度坐标和国测局坐标，用此方法设置您使用的坐标类型.
        //包括BD09LL和GCJ02两种坐标，默认是BD09LL坐标。
        SDKInitializer.setCoordType(CoordType.BD09LL);
        //右滑关闭
        Snake.init(this);
        //Bugly
//        CrashReport.initCrashReport(getApplicationContext(), "9812502edc", true);
    }

    public static Context getContext(){
        return mContext;
    }
}
